package net.love5z.web;

import org.mortbay.jetty.Server;
import org.mortbay.jetty.webapp.WebAppContext;

public class WebStarter {

    /**
     * @param args
     * @throws Exception 
     */
    public static void main(String[] args) throws Exception {
        System.setProperty("log4j.log.dir", System.getProperty("user.home") + "/logs");

        Server server = new Server(8080);

        WebAppContext context = new WebAppContext();
        context.setDescriptor("src/main/webapp" + "/WEB-INF/web.xml");
        context.setResourceBase("src/main/webapp");
        context.setContextPath("/");
        context.setParentLoaderPriority(true);

        server.setHandler(context);

        server.start();
        server.join();
    }

}
